package cn.zhaozhiqi.autoconfiguration;

import cn.zhaozhiqi.config.RedisConfig;
import cn.zhaozhiqi.config.SaTokenConfigure;
import cn.zhaozhiqi.config.StpInterfaceImpl;
import cn.zhaozhiqi.config.TokenInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.web.client.RestTemplate;

@Configuration
@Import({RedisConfig.class, SaTokenConfigure.class})
public class SaTokenAutoConfiguration {

    //如果需要交给Spring的配置类内有@Bean注解，就不能注入
    @Bean
    public StpInterfaceImpl stpInterfaceImpl(){
        return new StpInterfaceImpl();
    }

    @Bean
    public TokenInterceptor tokenInterceptor(){
        return new TokenInterceptor();
    }

}
